﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Xml.Linq;

namespace Kira.Compiler.Bods
{
    [XmlElementMapping("DICallStep")]
    public class DICallStep : BodsStep
    {

        public String CalledObjectName
        {
            get
            {
                return this.GetAttrbuteValue("name");
            }
        }

        public CalledObjectType CalledObjectType
        {
            get
            {
                return (CalledObjectType)Enum.Parse(typeof(CalledObjectType), this.GetAttrbuteValue("calledObjectType"), true);
            }
        }

        public IEnumerable<BodsExpression> Arguments
        {
            get
            {
                return from c in this.GetElement("DIParameterValues").Elements select c.FirstElement as BodsExpression;
            }
        }
    }

    public enum CalledObjectType
    {
        Dataflow, Workflow
    }
}
